package com.qf.day02;

import java.util.Scanner;

//会员购物时，根据输入积分的不同享受不同的折扣
//计算会员购物时获得的折扣输出实付金额
//会员积分x 折扣
//x ＜ 2000 9折
//2000 ≤ x ＜ 4000 8折
//4000 ≤ x ＜ 8000 7折
//x ≥ 8000 6折
public class Practice {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入积分");
        Double point = scanner.nextDouble();//提取积分
        System.out.println("请输入金额");
        Double price = scanner.nextDouble();//提取金额

        if(point>0&&price>0){
        if (point < 2000) {
            System.out.println("9折");
            Double str = 0.9*price; //设置折扣
            System.out.println(str);//输出优惠后金额



        } else if (point < 4000) {
            System.out.println("8折");
            Double str = 0.8*price; //设置折扣
            System.out.println(str);//输出优惠后金额

        } else if (point < 8000) {
            System.out.println("7折");
            Double str = 0.7*price; //设置折扣
            System.out.println(str);//输出优惠后金额

        }else{
            System.out.println("6折");
           Double str = 0.6*price; //设置折扣
            System.out.println(str);//输出优惠后金额

    }
    }else {System.out.println("输入有误");}
    }}